package DataStructure.demo02;

public class ReflectTest {
    public static void main(String[] args) {
        try {
            Class<?> c =Class.forName("DataStructure.demo02.Student");
            Object objectStudent = c.newInstance();
            Student s = (Student) objectStudent;
            System.out.println("获得学生对象："+s);
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
